Method and apparatus for encoding/decoding images using a motion vector

ABSTRACT

The present invention relates to image processing, and more particularly, to a video coding/decoding method using a clipped motion vector and an apparatus thereof. An embodiment of the present invention relates to a method of decoding an image. The method includes clipping a motion vector of a reference picture in a predetermined dynamic range to generate a clipped motion vector, storing the clipped motion vector in a buffer, deriving a motion vector of a coding treeblock using the motion vector stored in the buffer, and performing inter prediction decoding process using the motion vector of the coding treeblock. According to the exemplary embodiment of the present invention, a size of a memory required for storing motion vectors may be reduced.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/249,146 filed on Jan. 16, 2019, which is a continuation of U.S.patent application Ser. No. 13/979,214 filed on Jul. 11, 2013, now U.S.Pat. No. 10,244,252, which is a National Stage of InternationalApplication No. PCT/KR2012/000770, filed Jan. 31, 2012 and published asWO 2012/105807 on Aug. 9, 2012, which claims benefit under 35 U.S.C. §119(a) of Korean Patent Application No. 10-2011-0009636 filed Jan. 31,2011, Korean Patent Application No. 10-2011-0019166 filed Mar. 3, 2011,Korean Patent Application No. 10-2011-0050853 filed May 27, 2011, KoreanPatent Application No. 10-2011-0065707 filed Jul. 1, 2011, and KoreanPatent Application No. 10-2012-0010096 filed Jan. 31, 2012 in the KoreanIntellectual Property Office, the contents of all of which areincorporated herein by reference in their entireties. The applicant(s)hereby rescind any disclaimer of claim scope in the parentapplication(s) or the prosecution history thereof and advise the USPTOthat the claims in this application may be broader than any claim in theparent application(s).

TECHNICAL FIELD

The present invention relates to image processing, and moreparticularly, to a video coding/decoding method using a clipped motionvector and an apparatus thereof.

BACKGROUND

Recently, in accordance with the expansion of a broadcasting systemsupporting high definition (HD) resolution in the country and around theworld, many users have been accustomed to a high resolution anddefinition image, such that many organizations have conducted manyattempts to develop the next-generation video devices. In addition, asthe interest in HDTV and ultra high definition (UHD) having a resolutionfour times higher than that of HDTV has increased, a compressiontechnology for a higher-resolution and higher-definition video has beendemanded.

For image compression, an inter prediction technology of predictingpixel values included in a current picture from a picture before and/orafter the current picture, an intra prediction technology of predictingpixel values using pixel information in the picture, an entropy codingtechnology of allocating a short code to a symbol having a highappearance frequency and a long code to a symbol having a low appearancefrequency, or the like, may be used.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing an example of a structure of anencoder according to an exemplary embodiment of the present invention.

FIG. 2 is a block diagram showing an example of a structure of a decoderaccording to an exemplary embodiment of the present invention.

FIG. 3 shows examples of a coding/decoding object picture and areference picture.

FIG. 4 shows an example of limiting a dynamic range of a motion vector.

FIGS. 5 to 8 are flow charts showing a method of storing a motion vectorof a reference picture.

FIG. 9 shows an example of quantizing a motion vector.

FIGS. 10 to 13 show examples of fetching motion information from areference picture.

FIG. 14 is a flow chart showing a method of encoding an image accordingto the exemplary embodiment of the present invention.

FIG. 15 is a flow chart showing a method of decoding an image accordingto the exemplary embodiment of the present invention.

BRIEF SUMMARY OF INVENTION Technical Problem

The prevent invention provides a video coding/decoding method using aclipped motion vector and an apparatus thereof.

The present invention also provides a method for clipping a motionvector of a reference picture.

The present invention also provides a method for transmittinginformation on a motion vector.

Technical Solution

In accordance with an illustrative configuration, there is provided animage decoding apparatus. The apparatus includes a reference picturebuffer for storing a reference picture; and a motion compensating unitfor generating a prediction block using the reference picture and amotion vector of the reference picture. The motion vector of thereference picture is clipped in a predetermined range.

In addition, the motion vector of the reference picture is magnitudescaled and is clipped in the range. The motion vector is clipped in apredetermined fixed value range.

The motion vector of the reference picture is stored in a predeterminedblock unit. The motion compensating unit generates the prediction blockusing the motion vector of the reference picture stored in thepredetermined block unit.

In one example, X and Y components of the motion vector are clipped inthe same fixed value range. The motion vector is a motion vector of ablock decoded in an inter-prediction mode.

In accordance with an illustrative configuration, there is provided animage decoding method. The method includes clipping a motion vector of areference picture in a predetermined range to generate a clipped motionvector; deriving a motion vector of a block to be decoded using themotion vector; and performing inter-prediction decoding using the motionvector of the block to be decoded.

The method also includes magnitude scaling the motion vector of thereference picture. The motion vector of the magnitude scaled referencepicture is clipped in the range. The motion vector is clipped in apredetermined fixed value range.

The motion vector of the reference picture is stored in a predeterminedblock unit, and, m deriving the motion vector, the motion vector of thereference picture stored in the predetermined block unit is derived.

In addition, X and Y components of the motion vector are clipped in thesame fixed value range. The motion vector is a motion vector of a blockdecoded in an inter-prediction mode.

In accordance with an illustrative configuration, there is provided animage encoding apparatus. The apparatus includes a reference picturebuffer for storing a reference picture; and a motion compensating unitfor generating a prediction blocking using the reference picture and amotion vector of the reference picture. The motion vector of thepreference picture is clipped in a predetermined range.

The motion vector of the reference picture is magnitude scaled and isclipped in the range. The motion vector is clipped in a predeterminedfixed value range. The motion vector of the reference picture is storedin a predetermined block unit, and the motion compensating unitgenerates the prediction block using the motion vector of the referencepicture stored in the predetermined block unit.

In addition, X and Y components of the motion vector are clipped in thesame fixed value range. The motion vector is a motion vector of a blockencoded in an inter-prediction mode.

Advantageous Effects

According to the exemplary embodiment of the present invention, thevideo may be coded using the clipped motion vector.

According to the exemplary embodiment of the present invention, a sizeof a memory required for storing motion vectors may be reduced.

According to the exemplary embodiment of the present invention, a memoryaccess bandwidth required for fetching data from the memory may bereduced.

DETAILED DESCRIPTION Mode for Invention

Hereinafter, exemplary embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings.However, in describing exemplary embodiments of the present invention,well-known functions or constructions will not be described in detailsince they may unnecessarily obscure the understanding of the presentinvention.

It is to be understood that when any element is referred to as being“connected to” or “coupled to” another element, it may be connecteddirectly to or coupled directly to another element or be connected to orcoupled to another element, having the other element interveningtherebetween. Further, in the present specification, in the case ofdescribing “including” a specific component, it is to be understood thatadditional components other than a corresponding component are notexcluded, but may be included in exemplary embodiments or the technicalscope of the present invention.

Terms used in the specification, ‘first’, ‘second’, etc., may be used todescribe various components, but the components are not to be construedas being limited to the terms. That is, the terms are used todistinguish one component from another component. For example, the‘first’ component may be named the ‘second’ component, and vice versa,without departing from the scope of the present invention.

In addition, components described in exemplary embodiments of thepresent invention are independently shown only in order to indicate thatthey perform different characteristic functions. Therefore, thecomponents that are independently shown do not mean that each of thecomponents may not be implemented as one hardware or software. That is,each of the components is divided for convenience of explanation, aplurality of components may be combined with each other to thereby beoperated as one component or one component may be divided into aplurality components to thereby be operated as the plurality ofcomponents, which are included in the scope of the present invention aslong as it departs from essential characteristics of the presentinvention.

In addition, some of components may not be indispensable componentsperforming essential functions of the present invention, but beselective components improving only performance thereof. The presentinvention may also be implemented only by a structure including theindispensable components except for the selective components, and thestructure including only the indispensable components is also includedin the scope of the present invention.

FIG. 1 is a block diagram showing an example of a structure of anencoder according to an exemplary embodiment of the present invention.

Referring to FIG. 1, the encoder 100 includes a motion predictor 111, amotion compensator 112, an intra predictor 120, a switch 115, asubtracter 125, a transformer 130, a quantizer 140, an entropy encoder150, a dequantizer 160, an inverse transformer 170, an adder 175, afilter unit 180, and a reference picture buffer 190.

The encoder 100 encodes input images in an intra prediction mode or aninter prediction mode to encoder output a bitstream. The intraprediction means intra-picture prediction and the inter prediction meansinter-picture prediction. The encoder 100 is switched between the intraprediction mode and the inter prediction mode through switching of theswitch 115. The encoder 100 generates a predicted block for an inputblock of the input image and then encodes a residual between the inputblock and the predicted block.

In the case of the intra prediction mode, the intra predictor 120performs spatial prediction using pixel values of neighboring blockswhich are coded already to generate predicted blocks.

In the case of the inter prediction mode, the motion predictor 111searches a reference block optimally matched with the input block in areference picture stored in the reference picture buffer 190 during amotion prediction process to obtain a motion vector. The motioncompensator 112 performs motion-compensation using the motion vector togenerate the predicted block. Here, the motion vector may be a twodimensional vector used for inter prediction and represent an offsetbetween a current coding treeblock and the reference block.

The subtracter 125 generate a residual block based on the residualbetween the input block and the predicted block, and the transformer 130transforms the residual block to output a transform coefficient. Thequantizer 140 quantizes the transform coefficient to output thequantized coefficient.

The entropy encoder 150 performs entropy encoding based on informationobtained during an encoding/quantizing process to output the bitstream.The entropy encoding represents frequently generated symbols as a smallnumber of bits, thereby reducing a size of a bitstream for a codingsymbol. Therefore, the compression performance of a video may beexpected to be improved through the entropy encoding. The entropyencoder 150 may use an encoding method such as exponential golomb,context-adaptive variable length coding (CAVLC), context-adaptive binaryarithmetic coding (CABAC), or the like, for the entropy encoding.

A coded picture needs to be again decoded and stored in order to be usedas a reference picture for performing the inter prediction coding.Therefore, the dequantizer 160 dequantizes the quantized coefficient,and the inverse transformer 170 inversely transforms the dequantizedcoefficient to output a reconstructed residual block. The adder 175 addsthe reconstructed residual block to the predicted block to generate areconstructed block.

The filter unit 180 is also called an adaptive in-loop filter andapplies at least one of deblocking filtering, sample adaptive offset(SAO) compensation, adaptive loop filtering (ALF) to the reconstructedblock. The deblocking filtering means that block distortion occurred ina boundary between blocks is removed, and the SAO compensation meansthat an appropriate offset is added to a pixel value in order tocompensate for a coding error. In addition, the ALF means that filteringis performed based on a comparison value between a reconstructed imageand an original image.

Meanwhile, the reference picture buffer 190 stores the reconstructedblock passing through the filter unit 180 therein.

FIG. 2 is a block diagram showing an example of a structure of a decoderaccording to an exemplary embodiment of the present invention.

Referring to FIG. 2, a decoder includes an entropy decoder 210, adequantizer 220, an inverse transformer 230, an intra predictor 240, amotion compensator 250, an adder 255, a filter unit 260, and a referencepicture buffer 270.

The decoder 200 decodes the bitstream in the intra prediction mode orthe inter prediction mode to output a reconstructed image. The decoder200 is switched between the intra prediction mode and the interprediction mode through switching of the switch. The decoder 200 obtainsa residual block from the bitstream to generate a predicted block andthen adds the residual block and the predicted block to each other togenerate a reconstructed block.

The entropy decoder 210 performs entropy decoding based on probabilitydistribution. The entropy decoding process is a process opposite to theabove-mentioned entropy encoding process. That is, the entropy decoder210 generates a symbol including a quantized coefficient from thebitstream in which a frequently generated symbol is represented as asmall number of bits.

The dequantizer 220 dequantizes the quantized coefficient, and theinverse transformer 230 inversely transforms the dequantized coefficientto generate a residual block.

In the case of the intra prediction mode, the intra predictor 240performs spatial prediction using pixel values of neighboring blockswhich are already coded to generate predicted blocks.

In the case of the inter prediction mode, the motion compensator 250performs the motion-compensation using the motion vector and thereference picture stored in the reference picture buffer 270 to generatethe predicted block.

The adder 255 adds the predicted block to the residual block, and thefilter unit 260 applies at least one of deblocking filtering, SAOcompensation, ALF to the block passing through the adder to output areconstructed image.

The reconstructed image may be stored in the reference picture buffer270 to thereby be used for the motion-compensation.

Hereinafter, a block means an encoding/decoding unit. In anencoding/decoding process, an image is divided at a predetermined sizeand then encoded/decoded. Therefore, a block may also be called a codingunit (CU), a prediction unit (PU), a transform unit (TU), or the like,and a single block may also be divided into sub-blocks having a smallersize.

Here, a prediction unit means a basic unit in which prediction and/ormotion-compensation is performed. A prediction unit may be divided intoa plurality of partitions, and each of the partitions may also be calleda prediction unit partition. When a prediction unit is divided into theplurality of partitions, each of prediction unit partitions may become abasic unit in which prediction and/or motion-compensation are performed.Hereinafter, in the exemplary embodiment of the present invention, aprediction unit may also mean prediction unit partitions.

Meanwhile, in high efficiency video coding (HEVC), a motion vectorprediction method based on advanced motion vector prediction (AMVP) isused.

In the motion vector prediction method based on advanced motion vectorprediction, a motion vector (MV) of a block, existing in a position thatis the same as or corresponds to that of a coding treeblock, in areference picture as well as motion vectors of reconstructed blockspositioned around the coding treeblock may be used. Here, the block,existing in a position that is the same as or spatially corresponds tothat of the coding treeblock, in the reference picture is called acollocated block, and a motion vector of the collocated block is calleda collocated motion vector or a temporal motion vector. However, thecollocated block may be a block, existing in a position similar to (thatis, corresponding to) that of the coding treeblock, in the referencepicture as well as a block existing in the same position as that of thecoding treeblock.

In a motion information merge method, motion information is estimatedfrom the collocated block as well as reconstructed blocks positionedaround the coding treeblock to thereby be used as motion information ofthe coding treeblock. Here, the motion information includes at least oneof inter prediction mode information indicating a reference pictureindex, a motion vector, a uni-direction, a bi-direction, or the like,required at the time of inter prediction, a reference picture list, andprediction mode information on whether encoding is performed in an intraprediction mode or in an inter prediction mode.

A predicted motion vector in the coding treeblock may be a motion vectorof the collocated block, which is a block temporally adjacent to thecoding treeblock, as well as motion vectors of neighboring blocksspatially adjacent to the coding treeblock.

FIG. 3 shows examples of a coding/decoding object picture and areference picture.

In FIG. 3, a block X indicates a coding treeblock in anencoding/decoding object picture 310, and a block A, a block B, a blockC, a block D, and a block E indicate reconstructed blocks positionedaround the coding treeblock. In addition, a block T in the referencepicture 320 indicates a collocated block existing in a positioncorresponding to that of the coding treeblock.

Which motion vector in the coding treeblock is used as the predictedmotion vector may be recognized through a motion vector predictor index.

TABLE 1 prediction_unit( x0, y0, log2PUWidth, log2PUHeight ) {Descriptor  if( skip_flag [ x0 ][ y0 ] ) {   if( NumMVPCand( L0 ) > 1 )   mpv_idx_l0[ x0 ][ y0 ] ue(v) | ae(v)   if( NumMVPCand( L1 ) > 1 )   mpv_idx_l1[ x0 ][ y0 ] ue(v) | ae(v)  } else if( PredMode ==MODE_INTRA ) {    ...  } else {/* MODE MERGE, MODE_INTER */   if(merge_flag[ x0 ][ y0 ] && NumMergeCandidates > 1 ) {    ...   } else {   if( inter_pred_idc[ x0 ][ y0 ] != Pred_L1 ) {     if( NumMVPCand( L0) > 1 )      mvp_idx_l0 ue(v) | ae(v)    }    if( inter_pred_idc[ x0 ][y0 ] != Pred_L0 ) {     if( NumMVPCand( L1 ) > 1 )      mvp_idx_l1 ue(v)| ae(v)    }   }  } }

As shown in Table 1, motion vector predictor indices mvp_idx_10 andmvp_idx_11 for each reference picture list are transmitted to a decoder,and the decoder uses the same motion vector as a motion vector predictedby an encoder as a predicted motion vector.

In the case in which the coding treeblock is encoded/decoded using themotion vectors of the neighboring blocks spatially adjacent to thecoding treeblock, the motion vector may be stored only with a memoryhaving a relative small size. However, in the case in which a temporalmotion vector is used, since all motion vectors of the reference pictureneeds to be stored in a memory, a memory having a relatively large sizeis required, and a size of a memory access bandwidth required to fetchdata from the memory also increases. Therefore, there is a need to moreefficiently store the temporal motion vector in an applicationenvironment in which a memory space of a portable terminal, or the like,is not sufficient or power consumption is minimized.

Meanwhile, as a technology of storing a motion vector in a memory, thereis a method of reducing a spatial resolution of the motion vector. Inthis method, the motion vector is compressed in any ratio and thenstored in the memory. For example, a motion vector stored in a 4×4 blockunit is stored in a 4×4 or more block unit to reduce the number ofstored motion vectors. Here, in order to adjust a block size of thestored motion vector, information on a compression ratio is transmitted.The information is transmitted through a sequence parameter set (SPS) asshown in Table 2.

TABLE 2 seq_parameter_set_rbsp( ) { C Descriptor  ..... motion_vector_buffer_comp_flag 0 u(1)  if (motion_vector_buffer_comp_flag )   motion_vector_buffer_comp_ratio_log20 u(8)  rbsp_trailing_bits( ) 0 }

Referring to Table 2, in the case in whichmotion_vector_buffer_comp_flag is 1, a motion vector buffer compressingprocess is performed.

motion_vector_buffer_comp_ratio_log 2 indicates a compression ratio ofthe motion vector buffer compressing process. In the case in which themotion_vector_buffer_comp_ratio_log 2 does not exist,motion_vector_buffer_comp_ratio_log 2 is estimated to 0, and a motionvector buffer compressing ratio is represented by Equation 1.

MVBufferCompRatio=1<<motion_vector_buffer_comp_ratio_log 2  [Equation 1]

For example, in the case in which all 4×4 blocks of 1920×1080 pictureshave different motion vectors and use two reference picture lists eachusing two reference pictures, a total memory space of 3.21 Mbytes isrequired to store a temporal motion vector as described below.

1. Bit depth of 26 bits per one motion vector

(1) Dynamic range of X component of motion vector: −252 to +7676 (bitdepth: 13 bits)

(2) Dynamic range of Y component of motion vector: −252 to +4316 (bitdepth: 13 bits)

(3) (The dynamic ranges of each component of the motion vector werecalculated based on a first prediction unit in a corresponding picture.)

2. In the case in which all of 4×4 block units have different motionvectors: 480×270=129600 blocks

3. Use of two motion vectors per each block

4. The number of reference picture lists: 2

5. Use of two reference pictures per reference picture list

⇒26 bits×129600 blocks×two motion vectors×two reference picturelists×two reference pictures=26956800 bits=3.21 Mbytes

According to the method of reducing a spatial resolution of a motionvector as described above, it is possible to reduce the size of therequired memory space and the memory access bandwidth using spatialcorrelation of the motion vector. However, the method of reducing aspatial resolution of a motion vector does not limit the dynamic rangeof the motion vector.

When the size of the memory space is reduced to ¼, a size of the memoryspace required in the above-mentioned example is reduced to about 0.8Mbytes. Here, when only six bits of the bit depth required for storingthe motion vector is used for each component of the motion vector byadditionally limiting the dynamic range of the motion vector, the sizeof the required memory space may be further reduced to 0.37 Mbytes.

Therefore, in the exemplary embodiment of the present invention, thedynamic range of the motion vector is limited in order to reduce a sizeof a memory space required for storing the motion vector and a memoryaccess bandwidth required for fetching data from the memory. The motionvector of the reference picture of which the dynamic range is limitedmay be used as a temporal motion vector in the coding treeblock.

Hereinafter, a dynamic range means a range between a minimum value and amaximum value of a negative component or a positive component of amotion vector based on 0, and a bit depth, which indicates a size of aspace required for storing the motion vector, means a bit width. Inaddition, unless particularly described, the motion vector means amotion vector of a reference picture, that is, a temporal motion vector.

In the case in which each component of the motion vector is out of thedynamic range, it is represented by the minimum value or the maximumvalue of the corresponding dynamic range. For example, in the case inwhich an X component of the motion vector 312 and a maximum value of adynamic range of each component of the motion vector 256, the Xcomponent of the motion vector is limited to 256.

Likewise, in the case in which a bit depth of each component of themotion vector is 16 bits and the motion vector is (−36, 24), when thebit depth of each component of the motion vector is limited to 6 bits,each component of the motion vector has a dynamic range of −32 to +31,such that the motion vector is represented by (−32, 24), which is in itsdynamic range.

Further, in the case in which a bit depth of each component of themotion vector is 16 bits and the motion vector is (−49, 142), when thebit depth of each component of the motion vector is limited to 9 bits,each component of the motion vector has a dynamic range of −256 to +255,such that the motion vector is represented by (−49, 142) without achange.

FIG. 4 shows an example of limiting a dynamic range of a motion vector.

Referring to FIG. 4, when a dynamic range of a motion vector having adynamic range of −4096 to +4095 is limited to −128 to +127, a bit depthmay be reduced from 13 bits to 8 bits.

Each component of a temporal motion vector is clipped as represented byEquations 2 and 3 in order to be stored in a bit depth of N bit(s).Where N indicates a positive integer.

clippedMV_X=min(1<<(N−1)−1,max(−1<<(N−1),MV_X))  [Equation 2]

clippedMV_Y=min(1<<(N−1)−1,max(−1<<(N−1),MV_Y))  [Equation 3]

Where MV_X indicates an X component of the motion vector, MV_Y indicatesa Y component of the motion vector, min(a,b) means an operation ofoutputting a smaller value in a and b, and max(a,b) means an operationof outputting a larger value in a and b. Each of clippedMV_X andclippedMV_Y indicates X and Y components of the clipped temporal motionvector and is stored in the memory to thereby be used as a temporalmotion vector of the coding treeblock.

For example, as shown in Table 3, in the case in which a size of amemory space is 48 bytes and each component of the motion vector uses abit depth of 16 bits, a total of twelve motion vectors may be stored.

TABLE 3 MV1-X MV1-Y MV2-X MV2-Y MV3-X MV3-Y MV4-X MV4-Y MV5-X MV5-YMV6-X MV6-Y MV7-X MV7-Y MV8-X MV8-Y MV9-X MV9-Y MV10-X MV10-Y MV11-XMV11-Y MV12-X MV12-Y

However, when each component of the motion vector uses only a bit depthof 8 bits, a total of twenty four motion vectors may be stored as shownin Table 4.

TABLE 4 MV1-X MV1-Y MV2-X MV2-Y MV3-X MV3-Y MV4-X MV4-Y MV5-X MV5-YMV6-X MV6-Y MV7-X MV7-Y MV8-X MV8-Y MV9-X MV9-Y MV10-X MV10-Y MV11-XMV11-Y MV12-X MV12-Y MV13-X MV13-Y MV14-X MV14-Y MV15-X MV15-Y MV16-XMV16-Y MV17-X MV17-Y MV18-X MV18-Y MV19-X MV19-Y MV20-X MV20-Y MV21-XMV21-Y MV22-X MV22-Y MV23-X MV23-Y MV24-X MV24-Y

Therefore, according to the exemplary embodiment of the presentinvention, when an image reconstructed in an encoder and/or a decoder issubjected to an in-loop filtering process such as a deblocking filter,an adaptive loop filter, or the like, and then stored in a decodedpicture buffer (DPB), the dynamic range of the motion vector is limited,such that a motion vector of a reference picture is stored. The decodedpicture buffer means the reference picture buffer of FIG. 1 or FIG. 2.

I. Process of Clipping Motion Vector

A process of clipping each component of a motion vector is invoked inthe case in which a slice_type is not equal to I. The process ofclipping a motion vector is performed in a treeblock or largest codingunit (LCU) after a filtering process is finished.

Inputs in the process of clipping a motion vector are a location (xP,yP) specifying the top-left sample of the prediction unit relative tothe top-left sample of the current picture, and motion vector matricesMvL0 and MvL1. Outputs in the process are the clipped motion vectormatrices CMvL0 and CMvL1.

With respect to the matrices MvL0, MvL1, CMvL0, and CMvL1, operations ofEquations 4 to 7 are performed.

mvLX=MvLX[xP,yP]  [Equation 4]

cmvLX[0]=Clip3(−1<<(TMVBitWidth−1),1<<(TMVBitWidth−1)−1,mvLX[0])  [Equation5]

cmvLX[1]=Clip3(−1<<(TMVBitWidth−1),1<<(TMVBitWidth−1)−1,mvLX[1])  [Equation6]

CMvLX[xP,yP]=cmvLX  [Equation 7]

Where TMVBitWidth indicates a bit depth of a motion vector, Clip3(a, b,c) means a function of clipping c so as to exist in a range between aand b.

II. Process of Storing Motion Vector

FIGS. 5 to 8 are flow charts showing a method of storing a motion vectorof a reference picture.

Referring to FIG. 5, the motion vector of the reference picture may bestored using both of an image buffer storing a reconstructed image and amotion vector buffer storing a motion vector. Here, the reconstructedimage is subjected to an in-loop filtering process (S510) and the motionvector is subjected to a limiting dynamic range process (S520) and thenstored (S540).

In addition, referring to FIG. 6, both of an image buffer and a motionvector buffer are used, and the motion vector is subjected to a limitingdynamic range process (S620) and a reducing spatial resolution process(S630) and then stored (S640).

Further, referring to FIG. 7, the reconstructed image is subjected to anin-loop filtering process (S710) and then stored in an image buffer(S740), and the motion vector is subjected to a limiting dynamic rangeprocess (S720) and then stored in a motion vector buffer (S750).

Further, referring to FIG. 8, the reconstructed image is subjected to anin-loop filtering process (S810) and then stored in an image buffer(S840), and the motion vector is subjected to a limiting dynamic rangeprocess (S820) and a reducing spatial resolution process (S830) and thenstored (S850).

Meanwhile, in the exemplary embodiments of FIGS. 6 and 8, a sequence ofthe limiting dynamic range process S620 or S820 and the reducing spatialresolution process S630 and S830 is not limited, but may be changed.

In addition, in order to further reduce a memory access bandwidth,dynamic ranges of each component of the motion vector may be differentlylimited. For example, only one of a dynamic range of an X component anda dynamic range of a Y component may be limited or the dynamic range ofthe Y component may be further limited as compared to the dynamic rangeof the X component.

The limited dynamic range of the motion vector is transmitted through asequence parameter set, a picture parameter set (PPS), a slice header,or the like, and the decoder similarly performs limitation of a dynamicrange of a temporal motion vector in the sequence, the picture, or theslice. In this case, a bit depth, which is a size of a memory spacerequired for storing the motion vector represented in the dynamic rangemay also be transmitted. In addition, it is possible to efficientlystore the temporal motion vector so as to be matched to motioncharacteristics of the image using the dynamic range transmitted throughthe sequence parameter set, the picture parameter set, the slice header,or the like, rather than storing the motion vector using a bit depthhaving a fixed size.

Meanwhile, the motion vector may be quantized and stored. In the case inwhich the motion vector is quantized and stored, precision of the motionvector is reduced. As a quantizing method, there are uniformquantization in which step sizes are uniform, non-uniform quantizationin which step sizes are non-uniform, and the like. The step size in thequantization is set to a fixed value predefined between the encoder andthe decoder or is transmitted from the encoder to the decoder throughthe sequence parameter set, the picture parameter set, the slice header,or the like. The decoder uses the quantized motion vector as it is ordequantizes and use the quantized motion vector. FIG. 9 shows an exampleof quantizing a motion vector. Referring to FIG. 9, in the case in whichthe motion vector has a component value of 32 to 48, the motion vectoris quantized to 40.

In addition, the motion vector may be limited in a representationresolution and the stored. The representation resolution means aninteger pixel unit (1 pixel unit), a fraction pixel unit (a ½ pixelunit, a ¼ pixel unit, or the like). For example, a resolution of themotion vector processed in a ¼ pixel unit may be stored as an integerpixel. The representation resolution of the motion vector is set to afixed value predefined between the encoder and the decoder or istransmitted from the encoder to the decoder through the sequenceparameter set, the picture parameter set, the slice header, or the like.

In addition, only with respect to some motion vectors among temporalmotion vectors stored in a memory, a limiting dynamic range process, areducing space resolution process, and a quantizing process of themotion vector may be performed.

In the case in which the dynamic range of the motion vector is limitedand stored, information on the dynamic range of the motion vector may beadded and stored in the memory. For example, in the case in which thedynamic range of the motion vector is −128 to +127, a flag of 1 may beadditionally stored, and in the case in which the dynamic range of themotion vector is −32 to +31, a flag of 0 may be additionally stored. Inthis case, flag information may be stored together with the motionvector or be stored in a memory different from the memory in which themotion vector is stored. In the case in which the flag information andthe motion vector are stored in different memories, when in whichdynamic range a specific motion vector is stored is recognized,arbitrary access to the flag information may be allowed. In addition,information on in which dynamic range some motion vectors are stored istransmitted through the sequence parameter set, the picture parameterset, the slice header, or the like, thereby making it possible to allowa decoder to perform an operation similar to that of an encoder.

In the case in which the spatial resolution of the motion vector isreduced and stored, information on a block size of the motion vector maybe added and stored in the memory. For example, in the case in which theblock size of the motion vector is 4×4, a flag of 1 may be additionallystored, and in the case in which the block size of the motion vector is16×16, a flag of 0 may be additionally stored. In this case, flaginformation may be stored together with the motion vector or be storedin a memory different from the memory in which the motion vector isstored. In the case in which the flag information and the motion vectorare stored in different memories, when in which block size a specificmotion vector is stored is recognized, arbitrary access to the flaginformation may be allowed. In addition, information on in which blocksize some motion vectors are stored is transmitted through the sequenceparameter set, the picture parameter set, the slice header, or the like,thereby making it possible to allow a decoder to perform an operationsimilar to that of an encoder.

In the case in which the motion vector is quantized and stored,information on precision of the motion vector may be added and stored inthe memory. For example, in the case in which a step size of thequantization is 4, a flag of 1 may be additionally stored, and in thecase in which the step size of the quantization is 1, a flag of 0 may beadditionally stored. In this case, flag information may be storedtogether with the motion vector or be stored in a memory different fromthe memory in which the motion vector is stored. In the case in whichthe flag information and the motion vector are stored in differentmemories, when at which step size a specific motion vector is quantizedand stored is recognized, arbitrary access to the flag information maybe allowed. In addition, information on at which step size some motionvectors are quantized and stored is transmitted through the sequenceparameter set, the picture parameter set, the slice header, or the like,thereby making it possible to allow a decoder to perform an operationsimilar to that of an encoder.

Further, in the case in which motion information is stored in thememory, the spatial resolution of the motion vector may be reduced andstored. Here, the motion information includes at least one of interprediction mode information indicating a reference picture index, amotion vector, a uni-direction, a bi-direction, or the like, required atthe time of inter prediction, a reference picture list, and predictionmode information on whether an intra prediction mode is performed or aninter prediction mode is performed.

For example, motion information of a prediction unit having the largestpartition size among a plurality of motion information of a specificregion may be stored as representative motion information in the memory.Here, the specific region may include a region in the coding treeblockand regions of neighboring blocks of the coding treeblock. In addition,the specific region may be a region including a block in which themotion information is stored in the case in which the entire picture orslice is divided at a predetermined size.

For example, after motion information, which is coded in a motioninformation merge method, a coding information skip method, or the like,is excluded from the plurality of motion information included in thespecific region, the representative motion information may be stored inthe memory.

For example, the most frequently generated motion information among theplurality of motion information included in the specific region may bestored as the representative motion information in the memory. In thiscase, the number of generation of the motion information for each sizeof the block, or the like, may be calculated.

For example, motion information at a specific position among theplurality of motion information included in the specific region may bestored. Here, the specific position, which is a position included in thespecific region, may be a fixed position of the specific region. Inaddition, the specific position may be selected as one of a plurality ofpositions. When the plurality of positions is used, a priority for eachposition may be determined, and the motion information may be stored inthe memory according to the priority.

For example, when the plurality of motion information included in thespecific region is stored in the memory, since the motion informationdoes not exist outside a boundary of a block coded in an intraprediction mode, a block coded in a pulse coded modulation (PCM) mode, aslice, or a picture, the motion information of the correspondingposition may not be stored in the memory.

In the above-mentioned examples, when the motion information of thespecific position is stored, in the case in which the motion informationof the corresponding position does not exist, motion information of acollocated block, motion information of a block coded already, or motioninformation of a neighboring block may be used as the motion informationof the corresponding position. Here, the specific position may be onesample position in a neighboring block or a position of the block. Forexample, in the case in which the motion information of the specificposition does not exist, a medium value or average value among motioninformation of neighboring blocks which are coded in inter predictionmay be stored in the memory. For example, in the case in which themotion information of the specific position does not exist, an averagevalue of motion information of neighboring blocks may be stored in thememory. When the medium value and the average value are calculated, inthe case in which the motion information of the neighboring blocks isdifferent from at least one of the reference picture index, thereference picture list, and the inter prediction mode information, asize of the motion vector may be adjusted according to the referencepicture index, the reference picture list, the inter prediction modeinformation, a picture order count, and the like.

III. Process of Deriving Motion Vector

In the case in which the motion information is stored in the memoryusing the above-mentioned motion information methods and the motioninformation of the reference picture is used in the motion vectorprediction method, the advanced motion vector prediction method, or themotion information merge method, the stored motion information may befetched.

For example, motion information of a position corresponding to that ofthe coding treeblock in the reference picture may be fetched. In thiscase, the position corresponding to that of the coding treeblock in thereference picture may be a fixed position in a specific region or arelative position from the position of the coding treeblock.

FIGS. 10 to 13 show examples of fetching motion information from areference picture.

In FIGS. 10 to 13, a block X indicates a coding treeblock in anencoding/decoding object picture 1010, 1110, 1210, or 1310, and a blockA, a block B, a block C, a block D, and a block E indicate reconstructedneighboring blocks. In addition, a block T in the reference picture1020, 1120, 1220, and 1320 indicates a collocated block corresponding tothe coding treeblock. A block Y in the reference picture 1320 of FIG. 13indicates a block corresponding to a position other than theencoding/decoding objet block.

Referring to FIG. 10, motion information corresponding to a positioncorresponding to a top-left pixel position among positions of a codingtreeblock X in a reference picture may be fetched.

Referring to FIG. 11, motion information corresponding to a positioncorresponding to a central pixel position among positions of a codingtreeblock X in a reference picture may be fetched.

Referring to FIG. 12, motion information corresponding to a positioncorresponding to a right-bottom pixel position among positions of acoding treeblock X in a reference picture may be fetched.

Referring to FIG. 13, motion information corresponding to a positioncorresponding to a pixel position other than a coding treeblock X in areference picture may be fetched.

An encoding/decoding method such as motion vector prediction, advancedmotion vector prediction, motion information merge, motion informationmerge skip, or the like, may be performed using the motion informationstored in the memory, that is, the motion information of the referencepicture.

The motion vector may be stored in the memory using at least one of amethod of limiting a dynamic range of a motion vector, a method ofreducing a spatial resolution of a motion vector, a method of quantizinga motion vector, and a method of reducing a representation resolution ofa motion vector, and the stored motion vector may be used for predictinga motion vector of the coding treeblock and merging motion informationthereof.

A process of fetching the motion vector of the reference picture fromthe memory is called a process of deriving a temporal motion vector. Ina process of deriving a temporal motion vector, TMVbitWidth indicates abit width of a temporal motion vector stored in the memory.

Inputs in the process of deriving a temporal motion vector are alocation (xP, yP) specifying the top-left luma sample of the currentprediction unit relative to the top-left sample of the current picture,variables specifying the width and the height of the prediction unit forluma, nPSW and nPSH, the reference index of the current prediction unitpartition refIdxLX (with X being 0 or 1). Outputs in the process are themotion vector prediction mvLXCol and the availability flagavailableFlagLXCol.

The function RefPicOrderCnt(pic, refidx, LX) is specified by the valueof PicOrderCnt of the picture that is the reference pictureRefPicListX[refidx] of pic with X being 0 or 1. PicOrderCnt of thereference picture shall be maintained until the picture is marked as“non-exisiting.” Clip3(a, b, c) means a function of clipping c so as toexist in a range between a and b.

If slice_type is equal to B and collocated_from_10_flag is equal to 0,the variable colPic specifies the picture that contains the co-locatedpartition as specified by RefPicList1 [0]. Otherwise (slice_type isequal to B and collocated_from_10_flag is equal to 1 or slice_type isequal to P), the variable colPic specifies the picture that contains theco-located partition as specified by RefPicList0[0].

Variable colPu and its position (xPCol, yPCol) are derived in thefollowing ordered steps:

1. Right-bottom luma position (xPRb, yPRb) of the current predictionunit is defined as represented by Equations 8 and 9.

xPRb=xP+nPSW  [Equation 8]

yPRb=yP+nPSH  [Equation 9]

2. If colPu is coded in an intra prediction mode or colPu isunavailable,

(1) Central luma position of the current prediction unit is defined asrepresented by Equations 10 and 11.

xPCtr=(xP+(nPSW>>1)−1  [Equation 10]

yPCtr=(yP+(nPSH>>1)−1  [Equation 11]

(2) The variable colPu is set as the prediction unit covering themodified position given by ((xPCtr>>4)<<4, (yPCtr>>4)<<4) inside thecolPic.

3. (xPCol, yPCol) is set equal to the top-left luma sample of the colPurelative to the top-left luma sample of the colPic.

The variables mvLXCol and availableFlagLXCol are derived as follows.

1. If colPu is coded in an intra prediction mode or colPu isunavailable, both components of mvLXCol are set equal to 0 andavailableFlagLXCol is set equal to 0.

2. Otherwise (colPu is not coded in an intra prediction mode and colPuis available), the variables mvCol and refIdxCol are derived as follows,

(1) If PredFlagL0[xPCol][yPCol] is equal to 0, the motion vector mvColand the reference index refIdxCol are set equal to MvL1[xPCol][yPCol]and RefIdxLl[xPCol][yPCol], respectively.

(2) Otherwise (PredFlagL0[xPCol][yPCol] is equal to 1), the followingapplies.

1) If PredFlagL1[xPCol][yPCol] is equal to 0, the motion vector mvColand the reference index refldxCol are set equal to MvL0[xPCol][yPCol]and RefldxL0[xPCol][yPCol], respectively.

2) Otherwise (PredFlagL1[xPCol][yPCol] is equal to 1), the followingapplies.

a. The following asignments are made with X being 0 or 1.

i. RefIdxColLX=RefldxLX[xPCol][yPCol]

ii. If PicOrderCnt(colPic) is less than PicOrderCnt(currPic) andRefPicOrderCnt(colPic, RefIdxColLX, LX) is greater thanPicOrderCnt(currPic) or PicOrderCnt(colPic) is greater thanPicOrderCnt(currPic) and RefPicOrderCnt(colPic, RefIdxColLX, LX) is lessthan PicOrderCnt(currPic), the variable MvXCross is equal to 1.

iii. Otherwise (PicOrderCnt(colPic) is less than PicOrderCnt(currPic)and RefPicOrderCnt(colPic, RefIdxColLX, LX) is less than or equal toPicOrderCnt(currPic) or PicOrderCnt(colPic) is greater thanPicOrderCnt(currPic) and RefPicOrderCnt(colPic, RefIdxColLX, LX) isgreater than or equal to PicOrderCnt(currPic)), the variable MvXCross isequal to 0.

b. If one of the following conditions is true, the motion vector mvCol,the reference index refldxCol and ListCol are set equal toMvL1[xPCol][yPCol], RefIdxColL1 and L1, respectively.

i. Mv0Cross is equal to 0 and Mv1Cross is equal to 1.

ii. Mv0Cross is equal to Mv1Cross and reference index list is equal toL1

c. Otherwise, the motion vector mvCol, the reference index refIdxCol andListCol are set equal to MvL0[xPCol][yPCol], RefIdxColL0 and L0,respectively.

3) the variable availableFlagLXCol is set equal to 1 and operations ofEquation 12 or Equations 13 to 18 are applied.

a. If PicOrderCnt(colPic)−RefPicOrderCnt(colPic, refIdxCol, ListCol) isequal to PicOrderCnt(currPic)−RefPicOrderCnt(currPic, refIdxLX, LX),

mvLXCol=Clip3(−1<<(TMVBitWidth−1),1<<(TMVBitWidth−1)−1,mvCol)  [Equation12]

b. Otherwise,

tx=(16384+Abs(td/2))/td  [Equation 13]

DistScaleFactor=Clip3(−1024,1023,(tb*tx+32)>>6)  [Equation 14]

mvLXCol=Clip3(−1<<(TMVBitWidth−1),1<<(TMVBitWidth−1)−1,mvCol)  [Equation15]

mvLXCol=ClipMv((DistScaleFactor*mvLXCol′+128)>>8)  [Equation 16]

where td and tb are derived as Equations 17 and 18.

td=Clip3(−128,127,PicOrderCnt(colPic)−RefPicOrderCnt(colPic,refIdxCol,ListCol))  [Equation17]

tb=Clip3(−128,127,PicOrderCnt(currPic)−RefPicOrderCnt(currPic,refIdxLX,LX))  [Equation18]

That is, referring to Equations 13 to 16, mvLXCol is derived as scaledversion of the motion vector mvCol.

Meanwhile, even though the motion vector is clipped in a dynamic range,in the case in which the clipped motion vector is scaled, the clippedmotion vector may be again out of the dynamic range. Therefore, afterthe scaled motion vector is derived, the dynamic range of the motionvector may be limited. In this case, each of Equations 15 and 16 may bereplaced with Equations 19 and 20.

mvLXCol′=ClipMv((DistScaleFactor*mvLXCol+128)>>8)  [Equation 19]

mvLXCol=Clip3(−1<<(TMVBitWidth−1),1<<(TMVBitWidth−1)−1,mvCol′)  [Equation20]

IV. Method of Transmitting Information for Clipping Temporal MotionVector in Decoder

Hereinafter, a method of transmitting information required for clippinga temporal motion vector in a decoder using the same method as that ofan encoder will be described.

TMVBitWidth in the process of deriving a temporal motion vector may betransmitted from the encoder to the decoder through a sequence parameterset, a picture parameter set, a slice header, or the like.

TABLE 5 saq_parameter_set_rbsp( ) { C Descriptor  ..... bit_width_temporal_motion_vector_minus8 0 se(v)  ..... rbsp_trailing_bits( ) 0 }

bit_width_temporal_motion_vector_minus8 of Table 5 specifies the bitwidth of the temporal motion vector component. Whenbit_width_temporal_motion_vector_minus8 is not present, it shall beinferred to be equal to 0. The bit width of temporal motion vectorcomponent is specified as follows:

TMVBitWidth=bit_width_temporal_motion_vector_minus8+8  [Equation 21]

1. Information transmitting method 1—in the case in which motion vectoris compressed and bit depth of motion vector is limited

TABLE 6 seq_parameter_set_rbsp( ) { C Descriptor  ..... motion_vector_buffer_comp_flag 0 u(1)  if(motion_vector_buffer_comp_flag )   motion_vector_buffer_comp_ratio_log20 u(8)  bit_depth_temporal_motion_vector_constraint_flag 0 u(1)  if(bit_depth_temporal_motion_vector_constraint_flag )  bit_depth_temporal_motion_vector_minus8 0 se(v)  ..... rbsp_trailing_bits( ) 0 }

Referring to Table 6, in the case in whichmotion_vector_buffer_comp_flag equals to 1 specifies the motion vectorbuffer compression process is applied.

motion_vector_buffer_comp_ratio_log 2 specifies the compression ratio inthe motion vector buffer compression process. Whenmotion_vector_buffer_comp_ratio_log 2 is not present, it shall beinferred to be equal to 0. The motion vector buffer compression ratio isspecified as follows:

MTVBufferCompRatio=1<<motion_vector_buffer_comp_ratio_log 2  [Equation22]

Again referring to Table 6, in the case in whichbit_depth_temporal_motion_vector_constraint_flag equals to 1 specifiesthe temporal motion vector bit depth limiting constraint process isapplied.

bit_depth_temporal_motion_vector_minus8 specifies the bit depth of thetemporal motion vector. When bit_depth_temporal_motion_vector_minus8 isnot present, it shall be inferred to be equal to 0. The bit depth oftemporal motion vector is specified as follows:

TMVBitDepth=bit_depth_temporal_motion_vector_minus8+8  [Equation 23]

2. Information transmitting method 2—in the case in which bit depth ofmotion vector is limited

TABLE 7 seq_parameter_set_rbsp( ) { C Descriptor  ..... bit_depth_temporal_motion_vector_constraint_flag 0 u(1)  if(bit_depth_temporal_motion_vector_constraint_flag )  bit_depth_temporal_motion_vector_minus8 0 se(v)  ..... rbsp_trailing_bits( ) 0 }

Referring to Table 7, in the case in whichbit_depth_temporal_motion_vector_constraint_flag equals to 1 specifiesthe temporal motion vector bit depth constraint process is applied.

bit_depth_temporal_motion_vector_minus8 specifies the bit depth of thetemporal motion vector. When bit_depth_temporal_motion_vector_minus8 isnot present, it shall be inferred to be equal to 0. The bit depth oftemporal motion vector is specified as follows:

TMVBitDepth=bit_depth_temporal_motion_vector_minus8+8  [Equation 24]

3. Information transmitting method 3—in the case in which bit depth ofmotion vector is limited

TABLE 8 seq_parameter_set_rbsp( ) { C Descriptor  ..... bit_depth_temporal_motion_vector_minus8 0 se(v)  ..... rbsp_trailing_bits( ) 0 }

bit_depth_temporal_motion_vector_minus8 specifies the bit depth of thetemporal motion vector. When bit_depth_temporal_motion_vector_minus8 isnot present, it shall be inferred to be equal to 0. The bit depth oftemporal motion vector is specified as follows:

TMVBitDepth=bit_depth_temporal_motion_vector_minus8+8  [Equation 25]

4. Information transmitting method 4—in the case in which bit depth islimited with respect to each of X and Y components of motion vector

TABLE 9 seq_parameter_set_rbsp( ) { C Descriptor  ..... bit_depth_temporal_motion_vector_constraint_flag 0 u(1)  if(bit_depth_temporal_motion_vector_constraint_flag ) {  bit_depth_temporal_motion_vector_x_minus8 0 se(v)  bit_depth_temporal_motion_vector_y_minus8 0 se(v)  }  ..... rbsp_trailing_bits( ) 0 }

Referring to Table 9, in the case in whichbit_depth_temporal_motion_vector_constraint_flag equals to 1 specifiesthe temporal motion vector bit depth constraint process is applied.

bit_depth_temporal_motion_vector_x_minus8 specifies the bit depth of thetemporal motion vector component x. Whenbit_depth_temporal_motion_vector_x_minus8 is not present, it shall beinferred to be equal to 0. The bit depth of temporal motion vectorcomponent x is specified as follows:

TMVXBitDepth=bit_depth_temporal_motion_vector_x_minus8+8  [Equation 26]

bit_depth_temporal_motion_vector_y_minus8 specifies the bit depth of thetemporal motion vector component y. Whenbit_depth_temporal_motion_vector_y_minus8 is not present, it shall beinferred to be equal to 0. The bit depth of temporal motion vectorcomponent y is specified as follows:

TMVXBitDepth=bit_depth_temporal_motion_vector_y_minus8+8  [Equation 27]

5. Information transmitting method 5—in the case in which motion vectoris compressed and bit depth of motion vector is limited

TABLE 10 seq_parameter_set_rbsp( ) { C Descriptor  ..... motion_vector_buffer_comp_flag 0 u(1)  if(motion_vector_buffer_comp_flag ) {  motion_vector_buffer_comp_ratio_log2 0 u(8)  bit_depth_temporal_motion_vector_minus8 0 se(v)  }  ..... rbsp_trailing_bits( ) 0 }

Referring to Table 10, in the case in whichmotion_vector_buffer_comp_flag equals to 1 specifies the motion vectorbuffer compression process is applied.

motion_vector_buffer_comp_ratio_log 2 specifies the compression ratio inthe motion vector buffer compression process. Whenmotion_vector_buffer_comp_ratio_log 2 is not present, it shall beinferred to be equal to 0. The motion vector buffer compression ratio isspecified as follows:

MVBufferCompRatio=1<<motion_vector_buffer_comp_ratio_log 2  [Equation28]

V. Definition of Dynamic Range Through Levels of Video Codec

The dynamic range of the temporal motion vector may be defined through alevel of a video codec rather than being transmitted through thesequence parameter set, the picture parameter set, or the slice header.The encoder and the decoder may determine a limited dynamic range of themotion vector using level information.

Further, even in the levels, dynamic ranges and/or bit depths of each ofthe X and Y components of the motion vector may be differently defined,and minimum values and maximum values of each of the components may bedefined.

Tables 11 and 12 show an example of a case in which TMVBitWidth in theprocess of deriving a temporal motion vector described above is definedin the levels.

TABLE 11 MaxTMVBitWidth (Max Temporal Level MV component number bitwidth) 1  8 1b  8 1.1  8 1.2  8 1.3  8 2  8 2.1  8 2.2  8 3  8 3.1 10 410 4.1 10 4.2 10 5 10 5.1 10

Referring to Table 11, TMVBitWidth is set as MaxTMVBitWidth defined inthe levels. Here, MaxTMVBitWidth indicates a maximum bit width of atemporal motion vector when the temporal motion vector is stored in thememory.

Meanwhile, TMVBitWidth may also be defined in the levels, and adifference from the defined value (a delta value) may be transmittedthrough the sequence parameter set, the picture parameter set, or theslice header. That is, TMVBitWidth may be set to as a value obtained byadding the difference transmitted through the sequence parameter set,the picture parameter set, or the slice header to MaxTMVBitWidth definedin the levels. Here, TMVBitWidth indicates a bit width of the temporalmotion vector when the temporal motion vector is stored in the memory.

TABLE 12 MaxTMVBitWidth (Max Temporal Level MV component number bitdepth) 1  8 1b  8 1.1  8 1.2  8 1.3  8 2  8 2.1  8 2.2  8 3  8 3.1 10 410 4.1 10 4.2 10 5 10 5.1 10

TABLE 13 seq_parameter_set_rbsp( ) { C Descriptor  ..... delta_bit_width_temporal_motion_vector_minus8 0 se(v)  ..... rbsp_trailing_bits( ) 0 }

delta_bit_width_temporal_motion_vector_minus8 specifies the delta bitwidth of the temporal motion vector component. Whendelta_bit_width_temporal_motion_vector_minus8 is not present, it shallbe inferred to be equal to 0. The bit width of temporal motion vectorcomponent is specified as follows:

TMVBitWidth=delta_bit_width_temporal_motion_vector_minus8+MaxTMVBitWidth  [Equation29]

In addition, as shown in Table 14, dynamic ranges of each component ofthe temporal motion vector may also be defined in levels.

TABLE 14 MaxBR (Max video bit MaxCPB rate) (Max CPB size) MaxTmvRMaxMBPS MaxDpbMbs (1000 bits/s, (1000 bits, (Max MaxMvsPer2 Mb (MaxMaxFS (Max 1200 bits/s, 1200 bits, Temporal MV (Max number macroblock(Max decoded cpbBrVdFactor pbBrVdFactor component MinCR of motionprocessing picture picture bits/s, or bits, or range (Min vectors pertwo Level rate) size) buffer size) cpbBrNalFactor cpbBrNalFactor (lumapicture compression consecutive number (MB/s) (MBs) (MBs) bits/s) bits)samples) ratio) MBs) 1  1 485   99   396    64   175  [−64, +63.75] 2 —1b  1 485   99   396   128   350  [−64, +63.75] 2 — 1.1  3 000   396  900   192   500 [−128, +127.75] 2 — 1.2  6 000   396  2 376   384  1000 [−128, +127.75] 2 — 1.3  11 880   396  2 376   768  2 000 [−128,+127.75] 2 — 2  11 880   396  2 376  2 000  2 000 [−128, +127.75] 2 —2.1  19 800   792  4 752  4 000  4 000 [−256, +255.75] 2 — 2.2  20 250 1620  8 100  4 000  4 000 [−256, +255.75] 2 — 3  40 500 1 620  8 100 10000 10 000 [−256, +255.75] 2 32 3.1 108 000 3 600 18 000 14 000 14 000[−512, +511.75] 4 16 3.2 216 000 5 120 20 480 20 000 20 000 [−512,+511.75] 4 16 4 245 760 8 192 32 768 20 000 25 000 [−512, +511.75] 4 164.1 245 760 8 192 32 768 50 000 62 500 [−512, +511.75] 2 16 4.2 522 2408 704 34 816 50 000 62 500 [−512, +511.75] 2 16 5 589 824 22 080  110400  135 000  135 000  [−512, +511.75] 2 16 5.1 983 040 36 864  184 320 240 000  240 000  [−512, +511.75] 2 16

In addition, as shown in Tables 15 to 17, bit widths of each componentof the temporal motion vector may also be defined in levels.

TABLE 15 MaxBR (Max video bit MaxCPB rate) (Max CPB size) MaxMBPSMaxDpbMbs (1000 bits/s, (1000 bits, MaxMvsPer2 Mb (Max MaxFS (Max 1200bits/s, 1200 bits, (Max number macroblock (Max decoded cpbBrVdFactorcpbBrVdFactor MaxTMVBitWidth MinCR of motion processing picture picturebits/s, or bits, or (Max Temporal (Min vectors per two Level rate) size)buffer size) cpbBrNalFactor cpbBrNalFactor MV component compressionconsecutive number (MB/s) (MBs) (MBs) bits/s) bits) bit width) ratio)MBs) 1  1 485   99   396    64   175 8 2 — 1b  1 485   99   396   128  350 8 2 — 1.1  3 000   396   900   192   500 8 2 — 1.2  6 000   396  2376   384  1 000 8 2 — 1.3  11 880   396  2 376   768  2 000 8 2 — 2  11880   396  2 376  2 000  2 000 8 2 — 2.1  19 800   792  4 752  4 000  4000 8 2 — 2.2  20 250 1 620  8 100  4 000  4 000 8 2 — 3  40 500 1 620 8 100 10 000 10 000 8 2 32 3.1 108 000 3 600 18 000 14 000 14 000 10 416 3.2 216 000 5 120 20 480 20 000 20 000 10 4 16 4 245 760 8 192 32 76820 000 25 000 10 4 16 4.1 245 760 8 192 32 768 50 000 62 500 10 2 16 4.2522 240 8 704 34 816 50 000 62 500 10 2 16 5 589 824 22 080  110 400 135 000  135 000  10 2 16 5.1 983 040 36 864  184 320  240 000  240 000 10 2 16

TABLE 16 MaxBR (Max video bit MaxCPB rate) (Max CPB size) MaxMBPSMaxDpbMbs (1000 bits/s, (1000 bits, MaxMvsPer2 Mb (Max MaxFS (Max 1200bits/s, 1200 bits, (Max number macroblock (Max decoded cpbBrVdFactorcpbBrVdFactor MaxTMVBitWidth MinCR of motion processing picture picturebits/s, or bits, or (Max Temporal (Min vectors per two Level rate) size)buffer size) cpbBrNalFactor cpbBrNalFactor MV component compressionconsecutive number (MB/s) (MBs) (MBs) bits/s) bits) bit width) ratio)MBs) 1  1 485   99   396    64   175 8 2 — 1b  1 485   99   396   128  350 8 2 — 1.1  3 000   396   900   192   500 8 2 — 1.2  6 000   396  2376   384  1 000 8 2 — 1.3  11 880   396  2 376   768  2 000 8 2 — 2  11880   396  2 376  2 000  2 000 8 2 — 2.1  19 800   792  4 752  4 000  4000 8 2 — 2.2  20 250 1 620  8 100  4 000  4 000 8 2 — 3  40 500 1 620 8 100 10 000 10 000 8 2 32 3.1 108 000 3 600 18 000 14 000 14 000 10 416 3.2 216 000 5 120 20 480 20 000 20 000 10 4 16 4 245 760 8 192 32 76820 000 25 000 10 4 16 4.1 245 760 8 192 32 768 50 000 62 500 10 2 16 4.2522 240 8 704 34 816 50 000 62 500 10 2 16 5 589 824 22 080  110 400 135 000  135 000  10 2 16 5.1 983 040 36 864  184 320  240 000  240 000 10 2 16

TABLE 17 MaxTMVBitWidth (Max Temporal Level MV component number bitwidth) 1  8 1b  8 1.1  8 1.2  8 1.3  8 2  8 2.1  8 2.2  8 3  8 3.1 10 410 4.1 10 4.2 10 5 10 5.1 10

In addition, as shown in Table 18, a bit width of a Y component of thetemporal motion vector may also be defined in levels.

TABLE 18 MaxBR (Max video bit MaxCPB rate) (Max CPB size) MaxMBPSMaxDpbMbs (1000 bits/s, (1000 bits, MaxMvsPer2 Mb (Max MaxFS (Max 1200bits/s, 1200 bits, (Max number macroblock (Max decoded cpbBrVdFactorcpbBrVdFactor MaxTMVYBitWidth MinCR of motion processing picture picturebits/s, or bits, or (Max Temporal (Min vectors per two Level rate) size)buffer size) cpbBrNalFactor cpbBrNalFactor MV component compressionconsecutive number (MB/s) (MBs) (MBs) bits/s) bits) bit width) ratio)MBs) 1  1 485   99   396    64   175 8 2 — 1b  1 485   99   396   128  350 8 2 — 1.1  3 000   396   900   192   500 8 2 — 1.2  6 000   396  2376   384  1 000 8 2 — 1.3  11 880   396  2 376   768  2 000 8 2 — 2  11880   396  2 376  2 000  2 000 8 2 — 2.1  19 800   792  4 752  4 000  4000 8 2 — 2.2  20 250 1 620  8 100  4 000  4 000 8 2 — 3  40 500 1 620 8 100 10 000 10 000 8 2 32 3.1 108 000 3 600 18 000 14 000 14 000 10 416 3.2 216 000 5 120 20 480 20 000 20 000 10 4 16 4 245 760 8 192 32 76820 000 25 000 10 4 16 4.1 245 760 8 192 32 768 50 000 62 500 10 2 16 4.2522 240 8 704 34 816 50 000 62 500 10 2 16 5 589 824 22 080  110 400 135 000  135 000  10 2 16 5.1 983 040 36 864  184 320  240 000  240 000 10 2 16

In addition, the dynamic range of the temporal motion vector may bedefined as a fixed value predefined between the encoder and the decoderwithout transmission of information on a limitation of the motion vectoror be stored in a form of a fixed bit depth.

In the case in which TMVBitWidth is fixed to the same value and used inthe encoder and the decoder, TMVBitWidth may be a positive integer suchas 4, 6, 8, 10, 12, 14, 16, or the like. Here, TMVBitWidth indicates thebit width of the temporal motion vector when the temporal motion vectoris stored in the memory.

FIG. 14 is a flow chart showing a method of encoding an image accordingto the exemplary embodiment of the present invention. Referring to FIG.14, the method of encoding an image includes a clipping step (S1410), astoring step (S1420), and an encoding step (S1430).

An apparatus of encoding an image and/or an apparatus of decoding animage clip a motion vector of a reference picture in a predetermineddynamic range (S1410). “As described above through “I. Process ofclipping motion vector”, the motion vector that is out of the dynamicrange is represented by a minimum value or a maximum value of thecorresponding dynamic range. Therefore, as described above through “IV.Method of transmitting information for clipping temporal motion vectorin decoder” and “V. Definition of dynamic range through levels of videocodec, the bit depth is limited through the level of the video codec,the sequence parameter set, and the like, or the dynamic range islimited through the level of the video codec, thereby making it possibleto clip the motion vector of the reference picture in the predetermineddynamic range.

The apparatus of encoding an image and/or the apparatus of decoding animage store the clipped motion vector of the reference picture in abuffer as described above through “II. Process of storing motion vector”(S1420). The motion vector may be stored in the buffer together with orseparately from the reconstructed image.

The apparatus of encoding an image encodes a motion vector of a codingtreeblock using the stored motion vector of the reference picture(S1430). As described above through “III. Process of deriving motionvector”, in the advanced motion vector prediction method used in theHEVC, a motion vector of a block existing in a position that is the sameor corresponds to that of the coding treeblock in the reference pictureas well as motion vectors of reconstructed blocks positioned around thecoding treeblock may be used. Therefore, the motion vector of the codingtreeblock may also be a motion vector of the reference picture, that is,a temporal motion vector, as well as motion vectors of neighboringblocks adjacent to the coding treeblock.

Meanwhile, since dynamic range of X component and Y component of themotion vector of the reference picture may be differently defined, eachcomponent of the motion vector of the reference picture may be clippedin each dynamic range.

In addition, a method of compressing a motion vector of a referencepicture as well as a method of limiting a dynamic range of a motionvector of a reference picture may be used. In the case of limiting thedynamic range of the motion vector of the reference picture orcompressing the motion vector of the reference picture, a flagindicating the dynamic range and the motion vector and a parameterrelated thereto may be defined in a level of a video codec, a sequenceparameter set, or the like.

In addition, an encoding method such as motion vector prediction,advanced motion vector prediction, motion information merge, motioninformation merge skip, or the like, may be performed using the motioninformation stored in the memory, that is, the motion information of thereference picture.

FIG. 15 is a flow chart showing a method of decoding an image accordingto the exemplary embodiment of the present invention. Referring to FIG.15, the method of decoding an image includes a clipping step (S1510), astoring step (S1520), a deriving step (S1530), and a decoding step(S1540).

The clipping step (S1510) and the storing step (S1520) of FIG. 15 aresimilar to the clipping step (S1410) and the storing step (S1420) ofFIG. 14 using “I. Process of clipping motion vector” and “II. Process ofstoring motion vector” described above. In addition, the deriving step(S1530) of FIG. 15 uses “III. Process of deriving motion vector”described above and is symmetrical to the encoding step (S1430) of FIG.14. Therefore, a detailed description thereof will be omitted.

An apparatus of decoding an image performs inter prediction decodingusing a motion vector of a coding treeblock (S1540). The apparatus ofdecoding an image may store a motion vector in a memory using at leastone of a method of limiting a dynamic range of a motion vector, a methodof reducing a spatial resolution of a motion vector, a method ofquantizing a motion vector, and a method of reducing a representationresolution of a motion vector, and use the stored motion vector forpredicting a motion vector of the coding treeblock and merging motioninformation thereof.

In addition, the apparatus of decoding an image may perform a decodingmethod such as motion vector prediction, advanced motion vectorprediction, motion information merge, motion information merge skip, orthe like, using the motion information stored in the memory, that is,the motion information of the reference picture.

Although the above-mentioned exemplary embodiments have describedthrough flow charts represented by a series of steps or blocks, thepresent invention is not limited to a sequence of the steps describedabove. That is, some steps may be generated in a different sequence orsimultaneously from or with other steps. In addition, it may beunderstood by those skilled in the art to which the present inventionpertains that the steps shown in the flow charts are non-exclusive, suchthat other steps may be included or some steps may be deleted.

In addition, the above-mentioned exemplary embodiments include examplesof various aspects. Although all possible combinations for showingvarious aspects are not described, it may be appreciated by thoseskilled in the art that other combinations may be made. Therefore, thepresent invention should be construed as including all othersubstitutions, alterations and modifications belong to the followingclaims.

What is claimed is:
 1. An image decoding apparatus comprising: areference picture buffer to store a reference picture; and one or moreprocessors to calculate a scaling factor based on a picture order countof the reference picture, clip the scaling factor in a firstpredetermined range, scale a motion vector of the reference picturebased on the clipped scaling factor, clip the scaled motion vector ofthe reference picture in a second predetermined range, generate aprediction block based on the reference picture and the clipped scaledmotion vector of the reference picture, and reconstruct a current blockin a current picture by adding the prediction block and a residual blockof the current block, wherein the motion vector of the reference pictureis determined as a motion vector of a collocated block in the referencepicture, wherein the motion vector of the collocated block is determinedby performing the ordered steps of: calculating a first positioncorresponding to a right-bottom position representing a positiondisplaced from an upper-left position of the current block in thecurrent picture by the current block's height and width, determining afirst block covering the first position in the reference picture,determining whether the first block is coded in an intra predictionmode, calculating, when the first block is coded in an intra predictionmode, a second position corresponding to a central position of thecurrent block in the current picture, and determining a second blockcovering the second position in the reference picture.
 2. The imagedecoding apparatus of claim 1, wherein the second predetermined range isa fixed value range.
 3. The image decoding apparatus of claim 1, whereinthe motion vector of the reference picture is stored in a predeterminedblock unit, wherein the motion compensator is further configured togenerate the prediction block using the motion vector of the referencepicture stored in the predetermined block unit.
 4. The image decodingapparatus of claim 2, wherein the motion compensator is furtherconfigured to clip X and Y components of the scaled motion vector in asame fixed value range.
 5. The image decoding apparatus of claim 1,wherein the motion vector of the reference picture is a motion vector ofa block decoded in an inter-prediction mode.
 6. An image encodingapparatus comprising: a reference picture buffer to store a referencepicture; one or more processors to generate a motion vector of a currentblock in a current picture and a prediction block of the current blockbased on the reference picture; and an encoder configured to calculate ascaling factor based on a picture order count of the reference picture,clip the scaling factor in a first predetermined range, scale a motionvector of the reference picture based on the clipped scaling factor,clip the scaled motion vector of the reference picture in a secondpredetermined range, encode the motion vector of the current block basedon the clipped scaled motion vector of the reference picture, and encodea residual block of the current block generated by subtracting theprediction block from the current block, wherein the motion vector ofthe reference picture is determined as a motion vector of a collocatedblock in the reference picture, wherein the motion vector of thecollocated block is determined by performing the ordered steps of:calculating a first position corresponding to a right-bottom positionrepresenting a position displaced from an upper-left position of thecurrent block in the current picture by the current block's height andwidth, determining a first block covering the first position in thereference picture, determining whether the first block is coded in anintra prediction mode, calculating, when the first block is coded in anintra prediction mode, a second position corresponding to a centralposition of the current block in the current picture, and determining asecond block covering the second position in the reference picture.
 7. Anon-transitory computer-readable storage medium storing a bitstream,wherein the bitstream is generated by an image encoding apparatus,wherein the image encoding apparatus comprises a reference picturebuffer to store a reference picture; a motion estimator to generate amotion vector of a current block in a current picture and a predictionblock of the current block based on the reference picture; and one ormore processors to calculate a scaling factor based on a picture ordercount of the reference picture, clip the scaling factor in a firstpredetermined range, scale a motion vector of the reference picturebased on the clipped scaling factor, clip the scaled motion vector ofthe reference picture in a second predetermined range, encode the motionvector of the current block based on the clipped scaled motion vector ofthe reference picture, and encode a residual block of the current blockgenerated by subtracting the prediction block from the current block,wherein the motion vector of the reference picture is determined as amotion vector of a collocated block in the reference picture, whereinthe motion vector of the collocated block is determined by performingthe ordered steps of: calculating a first position corresponding to aright-bottom position representing a position displaced from anupper-left position of the current block in the current picture by thecurrent block's height and width, determining a first block covering thefirst position in the reference picture, determining whether the firstblock is coded in an intra prediction mode, calculating, when the firstblock is coded in an intra prediction mode, a second positioncorresponding to a central position of the current block in the currentpicture, and determining a second block covering the second position inthe reference picture.
 8. A non-transitory computer-readable storagemedium storing a bitstream that is received and decoded by an imagedecoding apparatus to reconstruct a current block included in an image,the bitstream comprising: prediction information of the current block,wherein the image decoding apparatus comprises a reference picturebuffer to store a reference picture, and one or more processors,wherein, based on the prediction information, the one or more processorscalculate a scaling factor based on a picture order count of thereference picture, clip the scaling factor in a first predeterminedrange, scale a motion vector of the reference picture based on theclipped scaling factor, clip the scaled motion vector of the referencepicture in a second predetermined range, generate a prediction blockbased on the reference picture and the clipped scaled motion vector ofthe reference picture, and reconstruct a current block in a currentpicture by adding the prediction block and a residual block of thecurrent block, wherein the motion vector of the reference picture isdetermined as a motion vector of a collocated block in the referencepicture, wherein the motion vector of the collocated block is determinedby performing the ordered steps of: calculating a first positioncorresponding to a right-bottom position representing a positiondisplaced from an upper-left position of the current block in thecurrent picture by the current block's height and width, determining afirst block covering the first position in the reference picture,determining whether the first block is coded in an intra predictionmode, calculating, when the first block is coded in an intra predictionmode, a second position corresponding to a central position of thecurrent block in the current picture, and determining a second blockcovering the second position in the reference picture.